from repositories.product_repositories import ProductRepository
from schemas.product import ProductCreate, ProductResponse


class ProductService:
    def __init__(self, product_repo: ProductRepository):
        self.product_repo = product_repo


    def create_product(self, product_data: ProductCreate) -> ProductResponse:
        product = self.product_repo.create_or_update_product(product_data)
        return ProductResponse(**product.dict())
